package com.walala.dispatcher.global;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.walala.dispatcher.utils.CommonUtils;


public class Global {

	private static final Logger logger = LoggerFactory.getLogger(Global.class);
	
	public static String zk_addr;
	
	public static int server_port;

	public static String redis_addr;

	public static int redis_port;

	public static int redis_timeout;

	public static int redis_connTimeout;

	public static String dispatcher_server_path;

	public static String server_ip;
	
	static{
		try {
			
			Configuration config = new PropertiesConfiguration(CommonUtils.getRealPath() + "/config/config.properties");
			
			zk_addr = config.getString("zk_addr");
			server_port = config.getInt("server_port");
			redis_addr = config.getString("redis_addr");
			redis_port = config.getInt("redis_port");
			redis_timeout = config.getInt("redis_timeout");
			redis_connTimeout = config.getInt("redis_connTimeout");
			dispatcher_server_path = config.getString("dispatcher_server_path");
			server_ip = config.getString("server_ip");
			
		} catch (Exception e) {
			logger.error("init Global vari error");
		}
	}
	
}
